
//////////////////////////////////////////////////
/// "From Low-Cost Flights to the Ballot Box:  ///
///   How Eastern European Migration Shaped    ///
///        Far-Right Voting in London"         ///
///      By Elena Pupaza & Joachim Wehner      ///
///          The Journal of Politics           ///
//////////////////////////////////////////////////

* Replication do file (appendix figure on voter registration in London boroughs)
* Prepared with Stata/SE 17.0 for Mac
* November 17, 2022

* List of figures in chronological order (online appendix):
* Figure F.1: Estimated EU8+2 voter registration rates across wards in selected boroughs (2011)

* Data sources:
* Electors by nationality and ward are from responses to data requests the authors sent to the electoral services managers of London's 32 boroughs during November 2018 and May 2019. 
* The number of residents aged 18 or older and born in an EU8+2 country is from Census 2011 Commissioned Table CT0796 compiled by the Office for National Statistics.


gen EU8 = CzechRepublic + Estonia + Hungary + Latvia + Lithuania + Poland + Slovakia + Slovenia
gen EU2 = Bulgaria + Romania
gen EU_New = EU2 + EU8

sort Borough Ward
gen EU_New_Ratio = EU_New_Registry / EU_New_Census

list Borough Ward EU_New_Registry EU_New_Census

sum EU_New_Registry EU_New_Census

bysort Borough: egen median_borough = median(EU_New_Ratio)


*** Figure F.1: Estimated EU8+2 voter registration rates across wards in selected boroughs (2011)

graph hbox EU_New_Ratio if EU_New_Ratio ~= . & EU_New_Ratio < 1, /*
*/ over(Borough, sort(median_borough) label(labsize(10pt))) /*
*/ ytitle("Ratio of EU8+2 electors to adult residents born in EU8+2 (2011)", color(black) size(10pt)) /*
*/ ylabel( , nogrid labsize(10pt)) /*
*/ title(" ", size(4) color(black)) /*
*/ bar(1, color(64 105 166)) graphregion(color(white)) intensity(25) /*
*/ plotregion(color(white) lwidth(medium) lcolor(black)) name(registerplot, replace)
